package com.example.canteen.dao.impl;

import com.example.canteen.dao.CanteenExceptionDao;
import com.example.canteen.util.JDBCUtils;
import org.springframework.jdbc.core.JdbcTemplate;

public class CanteenExceptionDaoImpl implements CanteenExceptionDao {
    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public void save(int cid, int eid) {
        String sql = "insert into canteen_exception(cid,eid) value(?,?)";
        template.update(sql,cid,eid);
    }

    @Override
    public void delete(int cid) {
        String sql =  "DELETE FROM canteen_exception WHERE id=?";
        template.update(sql,cid);
        return;
    }
}
